package com.mstore.service;

import com.mstore.dao.MicroshopDao;
import com.mstore.pojo.Microshop;

public class MicroshopService {

	private MicroshopDao microshopDao;

	/**
	 * 保存
	 */
	public void addMicroshop(Microshop microshop) {
		microshopDao.addMicroshop(microshop);
	}

	/**
	 * 删除
	 */
	public void delMicroshop(Microshop microshop) {
		microshopDao.delMicroshop(microshop);
	}

	/**
	 * 修改微店地址
	 */
	public void updateMicroshop(Microshop microshop) {
		microshopDao.updateMicroshop(microshop);
	}

	/**
	 * 通过eaId查询微店地址
	 */
	public Microshop getMicroshopUrlByEaid(Long eaId) {
		Object obj = microshopDao.getMicroshopUrlByEaid(eaId);
		if (obj == null) {
			return null;
		}
		return (Microshop) obj;
	}
	
	/**
	 * 通过microId查询微店地址
	 */
	public Microshop getMicroshopUrlById(Long microId) {
		Object obj = microshopDao.getMicroshopUrlById(microId);
		if (obj == null) {
			return null;
		}
		return (Microshop) obj;
	}

	public MicroshopDao getMicroshopDao() {
		return microshopDao;
	}

	public void setMicroshopDao(MicroshopDao microshopDao) {
		this.microshopDao = microshopDao;
	}
}
